Release 10.1A: OpenEdge Development:
Progress 4GL Handbook
Deleting dynamic objects
You can delete a dynamic object with the
DELETE OBJECTstatement:
You can also use the
WIDGETkeyword in place ofOBJECTin this statement. Thehandleis a variable or temp-table field of typeHANDLE, which was previously used in aCREATEstatement to create the object. If there is no object currently associated with the handle, Progress returns an error when it tries to execute the statement. In cases where your statement might be attempting to delete an object that has not been created or which has already been deleted, and you don’t want to be informed of this at run time, you can avoid such an error by checking the handle in advance with theVALID-HANDLEfunction:
Alternatively, you can include the
NO-ERRORkeyword on theDELETEstatement to suppress any error message:
In either case, don’t forget the
OBJECTkeyword. If you do, Progress thinks you’re trying to delete a record from a table:
Figure 18–6 shows the result.
Figure 18–6: Unknown table error message
![]()
It’s also important that you understand that you cannot delete a static object using its handle. Consider, for example, this sequence of statements:
If you run this procedure you get the error shown in Figure 18–7 at run time.
Figure 18–7: Static handle error message
![]()
Progress deletes static objects for you when they go out of scope. You cannot delete them yourself.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |